home *** CD-ROM | disk | FTP | other *** search
- Path: gail.ripco.com!mambuhl
- From: mambuhl@ripco.com (Martin Ambuhl)
- Newsgroups: comp.lang.c
- Subject: Re: dereferencing pointer
- Date: 3 Mar 1996 09:00:28 GMT
- Organization: Ripco Communications, Inc.
- Message-ID: <4hbn3c$4q6@gail.ripco.com>
- NNTP-Posting-Host: golden.ripco.com
-
- D.C.Molero@dcs.warwick.ac.uk (Daniel Castillo Molero)
- in <1996Mar3.040741.27234@dcs.warwick.ac.uk> asks:
-
-
- :I wonder if anybody can help me to debug the short code below.
- :It is supposed to calculate the area of a polygon, but when I compile
- :it with gcc program.c, it gives me the following errors,
-
- :program.c: In function `calc_area':
- :program.c:22: warning: assignment from incompatible pointer type
- :program.c:24: dereferencing pointer to incomplete type
- :program.c:24: dereferencing pointer to incomplete type
- :program.c:26: warning: assignment from incompatible pointer type
-
-
- :which I don't understand at all.
-
- Daniel,
- These errors are the result of your mistyping the definition of the
- `struct polygon'. There is no definition for a `struct polyg'.
-
- Here is a corrected version:
-
- struct polygon {
- int tried;
- double x, y;
- int dir, numtimes, conv;
- struct polygon *next; /* mha - was `struct polyg *next;' */
- };
-
- --
- * Martin Ambuhl net: mambuhl@ripco.com
- * Chicago, IL (USA)
-